﻿using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

namespace Hxsoft.AppV1.Admin.VoteManage.Controls
{
	public partial class SettedVote : BaseUserControl
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!IsPostBack)
			{
				this.DataBind();
			}
		}

		#region 属性
		/// <summary>
		/// 属性 Order
		/// </summary>
		public int Order
		{
			get
			{
				return Convert.ToInt32(CtrlOrder.Text);
			}
			set
			{
				CtrlOrder.Text = value.ToString();
			}
		}

		/// <summary>
		/// 属性 IsEffective
		/// </summary>
		public bool IsEffective
		{
			get
			{
				return Convert.ToBoolean(CtrlIsEffective.Text);
			}
			set
			{
				CtrlIsEffective.Text = value.ToString();
			}
		}


		/// <summary>
		/// 控件的 VoteInfo 实例。
		/// </summary>
		public Module.Vote Info
		{
			get
			{
				Module.Vote vote = new Module.Vote();

				vote.IsEffective = IsEffective;
				vote.Order = Order;

				return vote;
			}
			set
			{
				if (value == null) return;

				IsEffective = value.IsEffective;
				Order = value.Order;
			}
		}
		#endregion
	}
}